package com.suibibk.springCloud.order.controller;


import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.suibibk.springCloud.order.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @RequestMapping("/add")
    public String add(String id) throws InterruptedException {
        Thread.sleep(1000);
        return "新增订单成功"+id;
    }


    @RequestMapping("/get")
    public String get(String id,String name) throws InterruptedException {
        return "查询订单"+id+";"+name;
    }


    @Autowired
    UserService userService;
    @RequestMapping("/test1")
    public String test1(){
        return userService.getUser();
    }
    @RequestMapping("/test2")
    public String test2(String id){
        return userService.getUser();
    }
}
